package org.qqmessage.dao;

import org.apache.ibatis.annotations.Param;
import org.qqmessage.entity.Tower;

public interface TowerDao {

    /**
     * 插入问题和答案
     * @param question,answer
     * @return
     */
    int insertQuestion(@Param("question") String question, @Param("answer")String answer);

    /**
     * 根据id删除问题
     * @param towerId
     * @return 如果影响行数等于1，表示删除成功
     */
    int deleteQuestion(int towerId);

    /**
     * 根据问题获得答案
     * @param question
     * @return
     */
    Tower queryByQuestion(String question);

    /**
     * 更新问答
     * @param towerId, question, answer
     * @return
     */
    int updateTower(@Param("towerId")int towerId, @Param("question")String question, @Param("answer")String answer);
}
